﻿<Window x:Class="LineGraphUpdateOnDataSourceChange.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
    Title="Window1" WindowState="Maximized" Loaded="Window_Loaded">
    <Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="*"/>
		</Grid.ColumnDefinitions>
		
		<ListBox Name="listBox" Grid.Column="0" ItemsSource="{Binding}"/>
		
		<ContentControl DataContext="{Binding SelectedItem, ElementName=listBox}" Grid.Column="1">
			<ContentControl.Template>
				<ControlTemplate>
					<Grid>
						<d3:ChartPlotter>
							<d3:LineGraph Stroke="Red" StrokeThickness="2" DataSource="{Binding}"/>
						</d3:ChartPlotter>
					</Grid>
				</ControlTemplate>
			</ContentControl.Template>
		</ContentControl>
	</Grid>
</Window>
